<template>
  <div>
    <p>商品数量:{{ count }}</p>
    <button v-on:click="count += 1">第一种方法</button>
    <button v-on:click="addFn">第二种</button>
    <button v-on:click="addCountFn(5)">第三种</button>
    <button @click="abc">第四种</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    addFn() {
      this.count++;
    },
    addCountFn(num) {
      this.count += num;
    },
    abc() {
      this.count--;
    },
  },
};
</script>

<style>
</style>